import {
	request
} from './request.js' //导入封装好的js文件

//登录
export const login = (data) => {
	return request({
		url: '/login',
		method: 'post',
		data
	})
}

// 获取课程列表
export const getCourseList = (data) => {
	return request({
		url: '/system/course/listByChapter?' + data,
		method: 'get',
	})
}

//添加课程
export const addCourse = (data) => {
	return request({
		url: '/system/course',
		method: 'post',
		data
	})
}

//获取封面图库
export const getCoverImage = (data) => {
	return request({
		url: '/system/image/list?' + data,
		method: 'get',
	})
}



//删除课程
export const delCourse = (id) => {
	return request({
		url: '/system/course/' + id,
		method: 'delete',
	})
}

//查看课程详情
export const getCourseDetail = (courseId) => {
	return request({
		url: '/system/course/' + courseId,
		method: 'get',
	})
}

//添加课程
export const editCourse = (data) => {
	return request({
		url: '/system/course',
		method: 'put',
		data
	})
}



